let string='hello';
console.log(string.replace(/^/,'a'));
console.log(string.replace(/$/,'a'));